using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Model.Xcode
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("DingTalkCallBackOperation", Description = "", ConnName = "DefaultDB", DbType = DatabaseType.SqlServer)]
    public partial class DingTalkCallBackOperation : IDingTalkCallBackOperation
    {
        #region 属性
        private Int64 _Id;
        /// <summary></summary>
        [DisplayName("Id")]
        [DataObjectField(true, true, false, 19)]
        [BindColumn("Id", "", "bigint")]
        public Int64 Id { get => _Id; set { if (OnPropertyChanging(__.Id, value)) { _Id = value; OnPropertyChanged(__.Id); } } }

        private String _EventType;
        /// <summary></summary>
        [DisplayName("EventType")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("EventType", "", "varchar(50)")]
        public String EventType { get => _EventType; set { if (OnPropertyChanging(__.EventType, value)) { _EventType = value; OnPropertyChanged(__.EventType); } } }

        private String _TimeStamp;
        /// <summary></summary>
        [DisplayName("TimeStamp")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("TimeStamp", "", "varchar(50)")]
        public String TimeStamp { get => _TimeStamp; set { if (OnPropertyChanging(__.TimeStamp, value)) { _TimeStamp = value; OnPropertyChanged(__.TimeStamp); } } }

        private String _UserId;
        /// <summary></summary>
        [DisplayName("UserId")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("UserId", "", "varchar(50)")]
        public String UserId { get => _UserId; set { if (OnPropertyChanging(__.UserId, value)) { _UserId = value; OnPropertyChanged(__.UserId); } } }

        private Int32 _IsOperation;
        /// <summary></summary>
        [DisplayName("IsOperation")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("IsOperation", "", "int")]
        public Int32 IsOperation { get => _IsOperation; set { if (OnPropertyChanging(__.IsOperation, value)) { _IsOperation = value; OnPropertyChanged(__.IsOperation); } } }

        private DateTime _CreateDate;
        /// <summary></summary>
        [DisplayName("CreateDate")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("CreateDate", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime CreateDate { get => _CreateDate; set { if (OnPropertyChanging(__.CreateDate, value)) { _CreateDate = value; OnPropertyChanged(__.CreateDate); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.Id: return _Id;
                    case __.EventType: return _EventType;
                    case __.TimeStamp: return _TimeStamp;
                    case __.UserId: return _UserId;
                    case __.IsOperation: return _IsOperation;
                    case __.CreateDate: return _CreateDate;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.Id: _Id = value.ToLong(); break;
                    case __.EventType: _EventType = Convert.ToString(value); break;
                    case __.TimeStamp: _TimeStamp = Convert.ToString(value); break;
                    case __.UserId: _UserId = Convert.ToString(value); break;
                    case __.IsOperation: _IsOperation = value.ToInt(); break;
                    case __.CreateDate: _CreateDate = value.ToDateTime(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得DingTalkCallBackOperation字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field Id = FindByName(__.Id);

            /// <summary></summary>
            public static readonly Field EventType = FindByName(__.EventType);

            /// <summary></summary>
            public static readonly Field TimeStamp = FindByName(__.TimeStamp);

            /// <summary></summary>
            public static readonly Field UserId = FindByName(__.UserId);

            /// <summary></summary>
            public static readonly Field IsOperation = FindByName(__.IsOperation);

            /// <summary></summary>
            public static readonly Field CreateDate = FindByName(__.CreateDate);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得DingTalkCallBackOperation字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String Id = "Id";

            /// <summary></summary>
            public const String EventType = "EventType";

            /// <summary></summary>
            public const String TimeStamp = "TimeStamp";

            /// <summary></summary>
            public const String UserId = "UserId";

            /// <summary></summary>
            public const String IsOperation = "IsOperation";

            /// <summary></summary>
            public const String CreateDate = "CreateDate";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface IDingTalkCallBackOperation
    {
        #region 属性
        /// <summary></summary>
        Int64 Id { get; set; }

        /// <summary></summary>
        String EventType { get; set; }

        /// <summary></summary>
        String TimeStamp { get; set; }

        /// <summary></summary>
        String UserId { get; set; }

        /// <summary></summary>
        Int32 IsOperation { get; set; }

        /// <summary></summary>
        DateTime CreateDate { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}